using Microsoft.Graphics.Canvas;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using Windows.Foundation;
using Windows.UI;

namespace DK.Baekdorf.MathTexRender
{
    // Box representing horizontal line.
    internal class HorizontalRule : Box
    {
        public HorizontalRule(double thickness, double width, double shift)
        {
            this.Width = width;
            this.Height = thickness;
            this.Shift = shift;
        }

        public override void Draw(CanvasDrawingSession drawingContext, double scale, double x, double y)
        {
#warning Need test
            // CB: Changed code
            var rect = new Rect(x * scale, (y - this.Height) * scale, this.Width * scale, this.Height * scale);
            drawingContext.FillRectangle(rect, Colors.Black);

            // CB: Old code
            //drawingContext.DrawRectangle(Colors.Black, null, new Rect(
            //    x * scale, (y - this.Height) * scale, this.Width * scale, this.Height * scale));
        }

        public override int GetLastFontId()
        {
            return TexFontUtilities.NoFontId;
        }
    }
}